package com.itec.learn.java.design.factory.abstractFactory;

import com.itec.learn.java.design.factory.Pizza;

/**
 * 重做起司披萨
 * @author chenyiqun
 */
public class NewCheesePizza extends Pizza {

    PizzaIngredientFactory factory;

    public NewCheesePizza(PizzaIngredientFactory factory){
        this.factory = factory;
    }

    /**
     * 该类不用关心这些原料，它只知道如何制作披萨
     * 现在Pizza和区域原料被解耦
     */
    @Override
    public void prepare() {
        cheese = factory.createCheese();
        clams = factory.createClams();
    }
}
